package com.crm.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the MENUBAR database table.
 * 
 */
@Entity
@NamedQuery(name="Menubar.findAll", query="SELECT m FROM Menubar m")
public class Menubar implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=1,allocationSize=1,name="MENUBAR_MID_GENERATOR", sequenceName="SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MENUBAR_MID_GENERATOR")
	@JSONField(name = "id")
	private Long mid;

	@JSONField(name = "text")
	private String mname;

	//bi-directional many-to-many association to Role
	@ManyToMany(mappedBy="menubars")
	@JSONField(serialize = false)
	private List<Role> roles;

	public Menubar() {
	}

	public Long getMid() {
		return this.mid;
	}

	public void setMid(Long mid) {
		this.mid = mid;
	}

	public String getMname() {
		return this.mname;
	}

	public void setMname(String mname) {
		this.mname = mname;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}